package com.company.show.factorys.method;


/**
 * @author yingfing
 * @create 2020--10--07 16:10
 * @describe
 */
public class Test {
    public static void main(String[] args) {
        /**
         * 1.目前只能生产奔驰车
         * 2.今天老板接了个单子,说咱们接了个代工宝马的单子
         *
         * 原则 :
         * 1.不能在我原来的工厂去修改机器
         * 2.完成老板的扩展业务的工作
         *
         */
        Factory factory = new BenziFactory();
        Car car = factory.makeCar();
        car.drive();

        factory = new BYDFactory();
        Car car1 = factory.makeCar();
        car1.drive();

        factory = new BWMFactory();
        Car car2 = factory.makeCar();
        car2.drive();
    }
}
